// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueWechatTitle from 'vue-wechat-title';

import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper)

import Vant from 'vant';
import 'vant/lib/index.css';

import $ from 'jquery'

Vue.use(Vant);




// 开发环境
if (process.env.NODE_ENV === 'development') {
  Vue.prototype.siteUrl = "http://116.62.67.10:18010"
  // Vue.prototype.siteUrl = "https://kabao.yintu168.com:18010"

}

// 生产环境
if (process.env.NODE_ENV === 'production') {
  Vue.prototype.siteUrl = "https://kabao.yintu168.com:18010"

}
import axios from 'axios';
Vue.prototype.axios = axios;

axios.interceptors.request.use(
  config => {
    if (localStorage.getItem('token')) {
      // 判断是否存在token，如果存在的话，则每个http header都加上token
      config.headers.token = `${localStorage.getItem('token')}`;
    }

    config.headers.buildId = "h5.kabao.www";

    return config;
  },
  err => {
    return Promise.reject(err);
  });

import md5 from 'js-md5';
Vue.prototype.md5 = md5;


Vue.use(VueWechatTitle);

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {
    App
  },
  template: '<App/>'
})
